<!--  -->
<template>
  <div>
    <van-nav-bar title="注册" fixed placeholder
    left-arrow @click-left="onClickLeft"/>
    <van-form @submit="onSubmit" class="regFrm">
      <van-field
        v-model="tel"
        name="tel"
        label="手机号"
        placeholder="手机号"
        :rules="[{ required: true, message: '请填写手机号' }]"
      />
      <div class="getCode">
        <van-field
        v-model="yanzheng"
        name="yanzheng"
        label="验证码"
        placeholder="验证码"
        :rules="[{ required: true, message: '请填写验证码' }]"
      />
      <van-button color="#7232dd" plain size="mini">验证码</van-button>
      </div>
      <div style="margin: 50px 30px;">
        <van-button round block type="info" native-type="submit">注册</van-button>
      </div>
    </van-form>
  </div>
</template>

<script>
export default {
  name:'reg',
  data () {
    return {
      yanzheng:'',
      tel:'',
      
    }
  },
  methods: {
    onSubmit(values) {
      console.log('submit', values);
    },
    onClickLeft(){
      this.$router.push('/my')
    }
  }
}
</script>

<style  scoped>
.regFrm{
  margin: 50px 20px;
}
.getCode{
  display: flex
}
.getCode>.van-field{
  width: 80%;
}
.getCode>.van-button{
  margin-top: 10px;
}
</style>
